In diesem Skript werden die Gebäude anhand von Informationen aus dem GWR den SIA Gebäudetypen zugeordnet. In einem zweiten Schritt werden Denkmalschutz-Bestimmungen auf die einzelnen Gebäude übertragen. Anhand einer Zonierung der Gebäude in Rolle werden zusätzlich öffentliche Gebäude ausgeschieden.
Anmerkung: Es werden ein paar Gebäudetypen verwendet, welche in der SIA nicht vorkommen (z.B. Schloss oder Kirche).
Die Daten aus dem vorhergehenden Arbeitsschritt werden eingelesen. Zusätzlich werden ein paar Werte pro Gebäude berechnet, welche für die spätere Visualisierung der SIA Klassifikation informativ sind.
load("output/01_output/geom/01_rolle_bld_out.Rdata")
#revising area
rolle_bld_out$GAREA<-sapply(rolle_bld_out@polygons,function(x){x@area})
#classifying age
rolle_bld_out$GBAUP<-cut(as.numeric(rolle_bld_out$GBAUJ),breaks=c(0,1919,1945,1960,1970,1980,1985,1990,1995,2000,2005,2010,2015,2500))
rolle_bld_out$GBAUP_rough<-cut(as.numeric(rolle_bld_out$GBAUJ),breaks=c(0,1950,2000,2500),labels = c("<1950","1950-2000",">2000"))
#table(is.na(rolle_bld_out$GBAUJ))
#calculating ebf
rolle_bld_out$ebf<-as.numeric(rolle_bld_out$GAREA)*as.numeric(rolle_bld_out$GASTW)
#table(is.na(rolle_bld_out$ebf))
#read information on denkmalschutz
dms<-read.csv(paste(dataPath,"19_denkmalschutz/denkmalschutz_egids.csv",sep=""))
names(dms)<-c("EGID","denkmalschutz")
dms<-dms[!duplicated(dms$EGID),]
#read zonierung
zonen<-readOGR(layer = "SAT_SAT_TPR_PAF", dsn = paste(dataPath,"20_Zonierung/PAF/",sep=""))
## OGR data source with driver: ESRI Shapefile
## Source: "/Volumes/data$/ta/60 FuE/6096 SCCER/609635 FEEBD-II/60963505 Work Packages/JA RED/06-Daten/20_Zonierung/PAF", layer: "SAT_SAT_TPR_PAF"
## with 608 features
## It has 20 fields
## Integer64 fields read as strings: NO_COM_FED NO_ZONE
proj4string(zonen)<-CRS("+init=epsg:21781")
## Warning in `proj4string<-`(`*tmp*`, value = new("CRS", projargs = "+init=epsg:21781 +proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=600000 +y_0=200000 +ellps=bessel +towgs84=674.4,15.1,405.3,0,0,0,0 +units=m +no_defs")): A new CRS was assigned to an object with an existing CRS:
## +proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=600000 +y_0=200000 +ellps=bessel +units=m +no_defs
## without reprojecting.
## For reprojection, use function spTransform
Die Klassen und Typen von Gebäuden aus dem GWR werden SIA Gebäudetypen zugeordnet. Dies ist ein weitestgehend manueller Schritt, welcher viele Entscheidungen umfasst. Es werden teilweise Bezeichnungen verwendet, welche in der SIA nicht vorkommen.
rolle_bld_out$klasKat<-paste(rolle_bld_out$GKLAS,rolle_bld_out$GKAT,sep="_")
rolle_bld_out$sia<-NA
rolle_bld_out_noSia<-rolle_bld_out
rolle_bld_out_sia<-rolle_bld_out
rolle_bld_out_sia<-rolle_bld_out_sia[-c(1:nrow(rolle_bld_out_sia)),]
##wichtige spezialfälle
#schloss
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$EGID == "9999999",]
rolle_bld_out_temp$sia <- "schloss"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[rolle_bld_out_noSia$EGID != "9999999",]
#migros
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$EGID == "280079171_1",]
rolle_bld_out_temp$sia <- "verkauf"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[rolle_bld_out_noSia$EGID != "280079171_1",]
#coop
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$EGID == "829466",]
rolle_bld_out_temp$sia <- "verkauf"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[rolle_bld_out_noSia$EGID != "829466",]
#hallenbad
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$EGID == "829857",]
rolle_bld_out_temp$sia <- "schwimmhalle"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[rolle_bld_out_noSia$EGID != "829857",]
#altersheim
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$EGID == "829895"|
rolle_bld_out_noSia$EGID == "829086"|
rolle_bld_out_noSia$EGID == "280010071"|
rolle_bld_out_noSia$EGID == "280027129"|
rolle_bld_out_noSia$EGID == "829084"|
rolle_bld_out_noSia$EGID == "280066318"|
rolle_bld_out_noSia$EGID == "828780"|
rolle_bld_out_noSia$EGID == "280078440",]
rolle_bld_out_temp$sia <- "altersheim"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[rolle_bld_out_noSia$EGID != "829895"&
rolle_bld_out_noSia$EGID != "829086"&
rolle_bld_out_noSia$EGID != "280010071"&
rolle_bld_out_noSia$EGID != "280027129"&
rolle_bld_out_noSia$EGID != "829084"&
rolle_bld_out_noSia$EGID != "280066318"&
rolle_bld_out_noSia$EGID != "828780"&
rolle_bld_out_noSia$EGID != "280078440",]
#krankenhaus
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$EGID == "829900",]
rolle_bld_out_temp$sia<- "krankenhaus"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[rolle_bld_out_noSia$EGID != "829900",]
#resti
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$EGID == "829427"|
rolle_bld_out_noSia$EGID == "829580"|
rolle_bld_out_noSia$EGID == "829423"|
rolle_bld_out_noSia$EGID == "190098292"|
rolle_bld_out_noSia$EGID == "829524"|
rolle_bld_out_noSia$EGID == "280062591_1"|
rolle_bld_out_noSia$EGID == "829697"|
rolle_bld_out_noSia$EGID == "829825",]
rolle_bld_out_temp$sia<- "restaurant"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[rolle_bld_out_noSia$EGID != "829427"&
rolle_bld_out_noSia$EGID != "829580"&
rolle_bld_out_noSia$EGID != "829423"&
rolle_bld_out_noSia$EGID != "190098292"&
rolle_bld_out_noSia$EGID != "829524"&
rolle_bld_out_noSia$EGID != "280062591_1"&
rolle_bld_out_noSia$EGID != "829697"&
rolle_bld_out_noSia$EGID != "829825",]
#AV nicht in GWR
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$source == "AVextra",]
rolle_bld_out_temp$sia <- "garage"
rolle_bld_out_temp$sia[rolle_bld_out_temp$EGID=="9999_ID87678053"] <-"verwaltung"
rolle_bld_out_temp$sia[rolle_bld_out_temp$EGID=="9999_ID9585245"] <-"kirche"
rolle_bld_out_temp$sia[rolle_bld_out_temp$EGID=="9999_ID9585124"|
rolle_bld_out_temp$EGID=="9999_ID9582178"|
rolle_bld_out_temp$EGID=="9999_ID9584587"|
rolle_bld_out_temp$EGID=="9999_ID9582623"|
rolle_bld_out_temp$EGID=="9999_ID26876653"|
rolle_bld_out_temp$EGID=="9999_ID61111124"] <-"leichte industrie"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[rolle_bld_out_noSia$source != "AVextra",]
##efh
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat == "1110_1021" |
rolle_bld_out_noSia$klasKat == "1121_1021",]
rolle_bld_out_temp$sia<- "efh"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat != "1110_1021" &
rolle_bld_out_noSia$klasKat != "1121_1021",]
##mfh
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat == "1122_1025" |
rolle_bld_out_noSia$klasKat == "1121_1025"|
rolle_bld_out_noSia$klasKat == "1110_1025" |
rolle_bld_out_noSia$klasKat == "1130_1040",]
rolle_bld_out_temp$sia<- "mfh"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat != "1122_1025"&
rolle_bld_out_noSia$klasKat != "1121_1025"&
rolle_bld_out_noSia$klasKat != "1110_1025"&
rolle_bld_out_noSia$klasKat != "1130_1040",]
##mischnutzung
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat == "1122_1030" |
rolle_bld_out_noSia$klasKat == "1110_1030"|
rolle_bld_out_noSia$klasKat == "1121_1030" |
rolle_bld_out_noSia$klasKat == "1274_1040",]
rolle_bld_out_temp$sia<- "mischnutzung"
#...wir möchten keine mischnutzung mehr haben, daher werden die mischnutzungen 50:50 zu verkauf und mfh zugewiesen
#...um eine randomisierung zu verhindern und damit ein unterschiedliches resultat pro durchlauf, werden alle geraden EGID zu mfh und alle ungeraden zu verkauf (verhältnis fast 50:50)
rolle_bld_out_temp$sia[as.numeric(rolle_bld_out_temp$EGID) %% 2 == 0]<-"mfh"
rolle_bld_out_temp$sia[as.numeric(rolle_bld_out_temp$EGID) %% 2 != 0]<-"verkauf"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat != "1122_1030"&
rolle_bld_out_noSia$klasKat != "1110_1030"&
rolle_bld_out_noSia$klasKat != "1121_1030"&
rolle_bld_out_noSia$klasKat != "1274_1040",]
##verkauf
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat == "1242_1060" |
rolle_bld_out_noSia$klasKat == "1230_1040"|
rolle_bld_out_noSia$klasKat == "1230_1060",]
rolle_bld_out_temp$sia<- "verkauf"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat != "1242_1060"&
rolle_bld_out_noSia$klasKat != "1230_1040"&
rolle_bld_out_noSia$klasKat != "1230_1060",]
##schule
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat == "1263_1060" |
rolle_bld_out_noSia$klasKat == "1263_1040",]
rolle_bld_out_temp$sia<- "schule"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat != "1263_1060"&
rolle_bld_out_noSia$klasKat != "1263_1040",]
##verwaltung
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat == "1220_1060" |
rolle_bld_out_noSia$klasKat == "1220_1040",]
rolle_bld_out_temp$sia<- "verwaltung"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat != "1220_1060"&
rolle_bld_out_noSia$klasKat != "1220_1040",]
##industrie
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat == "1251_1060" |
rolle_bld_out_noSia$klasKat == "1251_1040",]
rolle_bld_out_temp$sia<- "industrie"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat != "1251_1060"&
rolle_bld_out_noSia$klasKat != "1251_1040",]
##sporthalle
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat == "1265_1060" |
rolle_bld_out_noSia$klasKat == "1265_1040",]
rolle_bld_out_temp$sia<- "sporthalle"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat != "1265_1060"&
rolle_bld_out_noSia$klasKat != "1265_1040",]
##versammlungslokal
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat == "1272_1040" |
rolle_bld_out_noSia$klasKat == "1261_1060"|
rolle_bld_out_noSia$klasKat == "1274_1060"|
rolle_bld_out_noSia$klasKat == "1241_1060"|
rolle_bld_out_noSia$klasKat == "1241_1040",]
rolle_bld_out_temp$sia<- "versammlungslokal"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat != "1272_1040"&
rolle_bld_out_noSia$klasKat != "1261_1060"&
rolle_bld_out_noSia$klasKat != "1274_1060"&
rolle_bld_out_noSia$klasKat != "1241_1060"&
rolle_bld_out_noSia$klasKat != "1241_1040",]
##hotel
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat == "1211_1040",]
rolle_bld_out_temp$sia<- "hotel"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat != "1211_1040",]
##landwirtschaft
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat == "1271_1040" |
rolle_bld_out_noSia$klasKat == "1271_1060",]
rolle_bld_out_temp$sia<- "landwirtschaft"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat != "1271_1040"&
rolle_bld_out_noSia$klasKat != "1271_1060",]
##garage
#diese sind "ohne wohnnutzung" (& klasse = NA) und haben nur eine kleine grundfläche
rolle_bld_out_temp<-rolle_bld_out_noSia[as.numeric(rolle_bld_out_noSia$GAREA) < 50 &
(rolle_bld_out_noSia$klasKat == "NA_1060" |
rolle_bld_out_noSia$klasKat == "NA_1040"),]
rolle_bld_out_temp$sia<- "garage"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[(as.numeric(rolle_bld_out_noSia$GAREA) >= 50 & rolle_bld_out_noSia$klasKat != "NA_1060")| (as.numeric(rolle_bld_out_noSia$GAREA) >= 50 & rolle_bld_out_noSia$klasKat != "NA_1040"),]
##leichte industrie
#diese sind "ohne wohnnutzung" (& klasse = NA), haben aber eine relativ grosse fläche
rolle_bld_out_temp<-rolle_bld_out_noSia[as.numeric(rolle_bld_out_noSia$GAREA) > 100 &
(rolle_bld_out_noSia$klasKat == "NA_1060" |
rolle_bld_out_noSia$klasKat == "NA_1040"),]
rolle_bld_out_temp$sia<- "leichte industrie"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[(as.numeric(rolle_bld_out_noSia$GAREA) <= 100 & rolle_bld_out_noSia$klasKat != "NA_1060")| (as.numeric(rolle_bld_out_noSia$GAREA) <= 100 & rolle_bld_out_noSia$klasKat != "NA_1040"),]
##garage II
#flächen zwischen 50 und 100 m2 werden ebenfalls garagen, wenn sie eine längliche form haben
rolle_bld_out_temp<-rolle_bld_out_noSia[rolle_bld_out_noSia$klasKat == "NA_1060" |
rolle_bld_out_noSia$klasKat == "NA_1040",]
#circularity ist 1 bei kreisen und klein wenn umfang und fläche
rolle_bld_out_temp$circularity<-(4*3.14*as.numeric(rolle_bld_out_temp$GAREA))/(polyPerimeter(rolle_bld_out_temp))^2
rolle_bld_out_temp<-rolle_bld_out_temp[rolle_bld_out_temp$circularity<0.7,]
rolle_bld_out_temp$circularity<-NULL
rolle_bld_out_temp$sia<- "garage"
rolle_bld_out_sia<-rbind(rolle_bld_out_sia,rolle_bld_out_temp)
rolle_bld_out_noSia<-rolle_bld_out_noSia[!rolle_bld_out_noSia$EGID%in%rolle_bld_out_temp$EGID,]
rolle_bld_out<-rolle_bld_out_sia
Hier wird versucht die obige, ausführliche Liste an Gebäudetypen eindeutig den SIA Klassen zuzuordnen. Es werden die 12 SIA Nummern von SIA 380, S. 43 verwendet. Mischnutzung bekommt die SIA Nummer 99 zugeteilt.
levels(factor(rolle_bld_out$sia))
## [1] "altersheim" "efh" "garage"
## [4] "hotel" "industrie" "kirche"
## [7] "krankenhaus" "landwirtschaft" "leichte industrie"
## [10] "mfh" "restaurant" "schloss"
## [13] "schule" "schwimmhalle" "sporthalle"
## [16] "verkauf" "versammlungslokal" "verwaltung"
rolle_bld_out$siaNr<-99
rolle_bld_out$siaNr[rolle_bld_out$sia=="mfh"|
rolle_bld_out$sia=="hotel"]<-1
rolle_bld_out$siaNr[rolle_bld_out$sia=="efh"]<-2
rolle_bld_out$siaNr[rolle_bld_out$sia=="verwaltung"]<-3
rolle_bld_out$siaNr[rolle_bld_out$sia=="schule"]<-4
rolle_bld_out$siaNr[rolle_bld_out$sia=="verkauf"]<-5
rolle_bld_out$siaNr[rolle_bld_out$sia=="restaurant"]<-6
rolle_bld_out$siaNr[rolle_bld_out$sia=="versammlungslokal"|
rolle_bld_out$sia=="kirche"|
rolle_bld_out$sia=="schloss"]<-7
rolle_bld_out$siaNr[rolle_bld_out$sia=="krankenhaus"|
rolle_bld_out$sia=="altersheim"]<-8
rolle_bld_out$siaNr[rolle_bld_out$sia=="industrie"|
rolle_bld_out$sia=="leichte industrie"|
rolle_bld_out$sia=="landwirtschaft"]<-9
rolle_bld_out$siaNr[rolle_bld_out$sia=="garage"]<-10
rolle_bld_out$siaNr[rolle_bld_out$sia=="sporthalle"]<-11
rolle_bld_out$siaNr[rolle_bld_out$sia=="schwimmhalle"]<-12
Die Information zum Denkmalschutz stammt von diesem Link. Es wurde nur die Kategorien 1 (strikter Schutz; z.B: Schloss) und 2 (eingeschränkte Optionen für Nutzung und Renovation) auf die Gebäude von Rolle übertragen, da nur diese eine Relevanz für beispielsweise Energiesanierungen haben.
#join denkmalschutz code to EGIDS
dat<-rolle_bld_out@data
dat<-dat%>%
left_join(dms,by="EGID")
## Warning: Column `EGID` joining character vector and factor, coercing into
## character vector
rolle_bld_out@data<-dat
Die Gemeinde Rolle ist in Zonen unterschiedliche Bebauungsdichten, Gebäudetypen und Oberflächenbedeckung unterteilt. Diese Information wird für die Berechnung von Renovierungsszenarien wichtig. Die Zonierung kann ist unter folgendem Link verfügbar.
rolle_cntr<-gCentroid(rolle_bld_out,byid = T)
ov<-over(rolle_cntr,zonen)
rolle_bld_out$zonenAffecation<-ov$TYPE_PRINC
Hier wird eine Klassifikation der SIA Gebäudetypen in “wohnen” und “nichtWohnen” gemacht und visualisiert.
rolle_bld_out$nutzung<-NA
rolle_bld_out$nutzung[rolle_bld_out$sia=="efh"|
rolle_bld_out$sia=="mfh"] <- "wohnen"
rolle_bld_out$nutzung[rolle_bld_out$sia=="alterheim"|
rolle_bld_out$sia=="mischnutzung"|
rolle_bld_out$sia=="krankenhaus"|
rolle_bld_out$sia=="hotel"|
rolle_bld_out$sia=="restaurant"] <- "nichtWohnen"
rolle_bld_out$nutzung[is.na(rolle_bld_out$nutzung)] <- "nichtWohnen"
p1<-ggplot(rolle_bld_out@data, aes(x=nutzung))+
geom_bar()+
theme_minimal()+
ggtitle(paste("Gebaeudenutzung (Anzahl)",sep=""))+
theme(axis.text.x = element_text(angle = 45, hjust = 1))+
xlab("")
p2<-ggplot(rolle_bld_out@data, aes(x=nutzung,y=GAREA))+
geom_bar(stat = "identity")+
theme_minimal()+
ggtitle(paste("Gebaeudenutzung (Flaechensumme)",sep=""))+
theme(axis.text.x = element_text(angle = 45, hjust = 1))+
xlab("")
p3<-ggplot(rolle_bld_out@data, aes(x=nutzung,y=ebf))+
geom_bar(stat = "identity")+
theme_minimal()+
ggtitle(paste("Gebaeudenutzung (EBF Summe)",sep=""))+
theme(axis.text.x = element_text(angle = 45, hjust = 1))+
xlab("")
p.all0<-grid.arrange(p1,p2,p3,ncol=1)
p.all0
## TableGrob (3 x 1) "arrange": 3 grobs
## z cells name grob
## 1 1 (1-1,1-1) arrange gtable[layout]
## 2 2 (2-2,1-1) arrange gtable[layout]
## 3 3 (3-3,1-1) arrange gtable[layout]
p1<-ggplot(rolle_bld_out@data, aes(x=sia))+
geom_bar()+
theme_minimal()+
ggtitle(paste("SIA Gebaeudetypen (Anzahl)",sep=""))+
theme(axis.text.x = element_text(angle = 45, hjust = 1,size=14))+
xlab("")
p2<-ggplot(rolle_bld_out@data, aes(x=sia,y=GAREA))+
geom_bar(stat = "identity")+
theme_minimal()+
ggtitle(paste("SIA Gebaeudetypen (Flaechensumme)",sep=""))+
theme(axis.text.x = element_text(angle = 45, hjust = 1,size=14))+
xlab("")
p3<-ggplot(rolle_bld_out@data, aes(x=sia,y=ebf))+
geom_bar(stat = "identity")+
theme_minimal()+
ggtitle(paste("SIA Gebaeudetypen (EBF Summe)",sep=""))+
theme(axis.text.x = element_text(angle = 45, hjust = 1,size=14))+
xlab("")
p.all<-grid.arrange(p1,p2,p3,ncol=1)
p.all
## TableGrob (3 x 1) "arrange": 3 grobs
## z cells name grob
## 1 1 (1-1,1-1) arrange gtable[layout]
## 2 2 (2-2,1-1) arrange gtable[layout]
## 3 3 (3-3,1-1) arrange gtable[layout]
p1<-ggplot(rolle_bld_out@data, aes(x=sia))+
geom_bar()+
facet_wrap(facets = "GBAUP",ncol = 2)+
theme_bw()+
ggtitle(paste("SIA Gebaeudetypen (Anzahl)",sep=""))+
theme(axis.text.x = element_text(angle = 45, hjust = 1,size=14))+
xlab("")
p2<-ggplot(rolle_bld_out@data, aes(x=sia,y=GAREA))+
geom_bar(stat = "identity")+
facet_wrap(facets = "GBAUP",ncol = 2)+
theme_bw()+
ggtitle(paste("SIA Gebaeudetypen (Flaechensumme)",sep=""))+
theme(axis.text.x = element_text(angle = 45, hjust = 1,size=14))+
xlab("")
p3<-ggplot(rolle_bld_out@data, aes(x=sia,y=ebf))+
geom_bar(stat = "identity")+
facet_wrap(facets = "GBAUP",ncol = 2)+
theme_bw()+
ggtitle(paste("SIA Gebaeudetypen (EBF Summe)",sep=""))+
theme(axis.text.x = element_text(angle = 45, hjust = 1,size=14))+
xlab("")
p.all2<-grid.arrange(p1,p2,p3,ncol=1)
p.all2
## TableGrob (3 x 1) "arrange": 3 grobs
## z cells name grob
## 1 1 (1-1,1-1) arrange gtable[layout]
## 2 2 (2-2,1-1) arrange gtable[layout]
## 3 3 (3-3,1-1) arrange gtable[layout]
#erst alle daten in wgs projezieren fuer leaflet projektion
rolle_bld_out.wgs<-spTransform(rolle_bld_out,CRSobj = CRS("+init=epsg:4326"))
pal_sia <- colorFactor(palette="Set3", rolle_bld_out.wgs$sia)
pal_heiz <- colorFactor(palette="Set1", factor(rolle_bld_out.wgs$GHEIZ_text))
pal_energ <- colorFactor(palette="Set1", factor(rolle_bld_out.wgs$GENHZ_text))
pal_alter <- colorFactor(palette="YlOrRd", factor(rolle_bld_out.wgs$GBAUP))
pal_ebf <- colorBin(palette="YlOrRd",bins = 4, rolle_bld_out.wgs$ebf)
#visualisierung mit leaflet
m <- leaflet() %>%
addProviderTiles(providers$Stamen.TonerLite, group = "OSM (b/w)") %>%
addProviderTiles(providers$OpenStreetMap, group = "OSM") %>%
addProviderTiles("Esri.WorldImagery", group = "ESRI") %>%
addPolygons(data=rolle_bld_out.wgs,
stroke = TRUE,
fillOpacity = 1,
color = ~pal_sia(rolle_bld_out.wgs$sia),
opacity = 1,
weight=1,
fillColor = ~pal_sia(rolle_bld_out.wgs$sia),
popup=rolle_bld_out.wgs$sia,
group = "SIA Typen")%>%
addPolygons(data=rolle_bld_out.wgs,
stroke = TRUE,
fillOpacity = 1,
color = ~pal_heiz(rolle_bld_out.wgs$GHEIZ_text),
opacity = 1,
weight=1,
fillColor = ~pal_heiz(rolle_bld_out.wgs$GHEIZ_text),
popup=rolle_bld_out.wgs$GHEIZ_text,
group = "Heizung")%>%
addPolygons(data=rolle_bld_out.wgs,
stroke = TRUE,
fillOpacity = 1,
color = ~pal_energ(rolle_bld_out.wgs$GENHZ_text),
opacity = 1,
weight=1,
fillColor = ~pal_energ(rolle_bld_out.wgs$GENHZ_text),
popup=rolle_bld_out.wgs$GENHZ_text,
group = "Energie")%>%
addPolygons(data=rolle_bld_out.wgs,
stroke = TRUE,
fillOpacity = 1,
color = ~pal_alter(rolle_bld_out.wgs$GBAUP),
opacity = 1,
weight=1,
fillColor = ~pal_alter(rolle_bld_out.wgs$GBAUP),
popup=rolle_bld_out.wgs$GBAUP,
group = "Alter")%>%
addPolygons(data=rolle_bld_out.wgs,
stroke = TRUE,
fillOpacity = 1,
color = ~pal_ebf(rolle_bld_out.wgs$ebf),
opacity = 1,
weight=1,
fillColor = ~pal_ebf(rolle_bld_out.wgs$ebf),
popup=as.character(rolle_bld_out.wgs$ebf),
group = "EBF")%>%
addLayersControl(
baseGroups = c("OSM (b/w)", "OSM","ESRI"),
overlayGroups = c("SIA Typen","Heizung","Energie","Alter","EBF"),
options = layersControlOptions(collapsed = F)
)%>%
hideGroup(c("Heizung","Energie","Alter","EBF"))%>%
addLegend(title = "SIA Typen", pal = pal_sia, values = rolle_bld_out.wgs$sia, opacity = 1,position = "bottomright")%>%
addLegend(title = "Heizung", pal = pal_heiz, values = rolle_bld_out.wgs$GHEIZ_text, opacity = 1,position = "bottomleft")%>%
addLegend(title = "Energie", pal = pal_energ, values = rolle_bld_out.wgs$GENHZ_text, opacity = 1,position = "bottomleft")%>%
addLegend(title = "Alter", pal = pal_alter, values = rolle_bld_out.wgs$GBAUP, opacity = 1,position = "bottomleft")%>%
addLegend(title = "EBF", pal = pal_ebf, values = rolle_bld_out.wgs$ebf, opacity = 1,position = "bottomright")
## Warning in RColorBrewer::brewer.pal(max(3, n), palette): n too large, allowed maximum for palette Set3 is 12
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(max(3, n), palette): n too large, allowed maximum for palette Set3 is 12
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(max(3, n), palette): n too large, allowed maximum for palette YlOrRd is 9
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(max(3, n), palette): n too large, allowed maximum for palette YlOrRd is 9
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(max(3, n), palette): n too large, allowed maximum for palette Set3 is 12
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(max(3, n), palette): n too large, allowed maximum for palette YlOrRd is 9
## Returning the palette you asked for with that many colors
#leaflet karte ausführen
m
#html karte speichern
wd<-getwd()
htmlwidgets::saveWidget(m, file=paste(wd,"/output/02_output/map/02_mapSia.html",sep=""),selfcontained = T)
save(rolle_bld_out,file="output/02_output/geom/02_rolle_bld_out.Rdata")
ggsave(p.all0,filename = "output/02_output/viz/02_buildingPlotNutzung.png",dpi = 500,width = 15,height = 18,units = "cm")
ggsave(p.all,filename = "output/02_output/viz/02_buildingPlotSia.png",dpi = 500,width = 20,height = 25,units = "cm")
ggsave(p.all2,filename = "output/02_output/viz/02_buildingPlotSia_age.png",dpi = 500,width = 21,height = 60,units = "cm")